
{%include file="header.html" %} 
<div class="break"></div>


<div class="break_10"></div>
<form id="form1">
<div class="warp">
<div class="fm960" id="body">
        <div class="piece1">
            <div class="piece1_hd"></div>
            <div class="piece1_bd">
                <div style="width:960px;" id="content">
                    <div class="album_create">
	<h1 class="new_album">

				{%if $g_show.item.id%}编辑专辑{%else%}创建新专辑{%/if%}
        	</h1>
<div class="album_box">
	<dl class="pl30">
		<dt>*标题：</dt>
		<dd>
			<input type="text" name="title" value="{%$g_show.item.title%}" class="album_title r3">
			<span class="info_tip">最多25个字</span>
			
			<span class="error_icon">*请输入标题</span>
		</dd>
		
		<dt style="clear:both;">专辑介绍：</dt>
		<dd>
			<div class="content">
				<div style="margin:0" class="album_s r3">
					<textarea type="text" class="album_all r3" name="desc">{%$g_show.item.desc%}</textarea>
					<div class="album_mana">
						
					</div>
					
				</div>
			</div>
		</dd>
		<dt>显示类型：</dt>
		<dd id="dd_show_type">
			<input type="radio" name="show_type" value="0" checked=checked>瀑布模式 
			<!--<input type="radio" name="show_type" value="1" > 相册模式-->
			<span class="info_tip">最多25个字</span>
			
			<span class="error_icon">请输入标题</span>
		</dd>
		
		<dt>背景图：</dt>
		<dd>
			<input type="text" name="body_url" id="body_url" value="{%$g_show.item.body_url%}" class="album_title r3">远程地址 (背景图在我的专辑页不会生效)<br>
			<div id="yxxiu_uploader"></div>
			<span class="info_tip">可选</span>
			
		</dd>
		<dt>显示排序：</dt>
		<dd id="dd_show_order">
			<input type="radio" name="show_order" value="0" checked=checked>加入时间倒序
			<input type="radio" name="show_order" value="1">加入时间顺序
			<span class="info_tip">最多25个字</span>
			
			<span class="error_icon">请输入标题</span>
		</dd>


		<input type="hidden" name="body_attach" value="1" >
		<!--<dt>背景展示：</dt>
		<dd>
			
			<span class="error_icon">可选</span>
		</dd>
		-->
		<dt>专辑需知：</dt>
		<dd>
			刚创建的专辑是不会在<a href="/album/">专辑首页</a>显示的，需要收录5条以上内容
		</dd>
	</dl>



	
	<input type="hidden" name="id" value="{%$g_show.item.id%}">

	<div class="next_btn">
		<a id="creat_btn" href="javascript:void(0);" class="next_button r3">完成</a>
	</div>

</div>
</form>
</div>

                </div>
            </div>
            <div class="piece1_ft"></div>
        </div>
    </div>
		
<!-- 分页 -->
 
	<div class="pagination mt20">
		</div>


				</div>
		</div>
</div>
{%include file="footer_js.html" %}   



<script>

$("input:radio[value='{%$g_show.item.show_type%}']").attr("checked","checked")
$("input:checkbox[value='{%$g_show.item.body_attach%}']").attr("checked","checked")

$("#creat_btn").bind("click",function(e){
	$.ajax({
		type:"post",
		url:"/interface/album/json_user_add_album.php",
		data:$("#form1").serialize(),
		dataType:"text",	
		complete:function(xhr,statusText){
			if(statusText == "success"){
				var result = eval("("+xhr.responseText+")");
				if(result.error == 1)
				{
					YOUXIXIU.MAIN.Tips.Show(result.errmsg);
				}
				else
				{
					YOUXIXIU.MAIN.Tips.Show(result.errmsg);

					location.href="/user/my_album_detail.php?id="+result.data.id;
				}
				
			}else{
				alert("网络传输失败")
			}
		}
	});


});




</script>




<script type="text/javascript">
$(function(){
	options={
		callback:'/js/uploader_callback.html',
		container:'#yxxiu_uploader',
		script:'/interface/common/json_mblog_pic_upload.php',
		size:"300|300",
		thumb:1,
		onComplete:function(res){
		$("#body_url").val(res.pic1);
	
					return ;
				},
		errorId:'#errormsg'
	};
	YOUXIXIU.ImgUploader.init(options);
});
</script>

{%include file="footer.html" %}   